﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using CSKLiteWindowsPhone.Common;
using SQLiteClient;
using CSKLiteWindowsPhone.WebsiteData;

namespace CSKLiteWindowsPhone
{
    public partial class TestSessionResults : PhoneApplicationPage
    {
        SQLiteConnection _db = Utility.GetConnection();
        public TestSessionResults()
        {
            InitializeComponent();

            this.Loaded += new RoutedEventHandler(TestCases_Loaded);
        }

        void TestCases_Loaded(object sender, RoutedEventArgs e)
        {
            SQLiteCommand cmd = this._db.CreateCommand("select * from TestSessionResult");
            IEnumerable<DetailedResult> tests = cmd.ExecuteQuery<DetailedResult>();

            this.listSessionResults.ItemsSource = tests;
        }
    }
}